/**
 * @file Condition.h
 * @author your name (you@domain.com)
 * @brief
 * @version 0.1
 * @date 2022-04-05
 *
 * @copyright Copyright (c) 2022
 *
 */

#pragma once

#include "Noncopyable.h"
#include <pthread.h>

namespace wd
{

class MutexLock;

class Condition : Noncopyable
{
  public:
    Condition(MutexLock &mutex);
    ~Condition();

    void wait();
    void notify();
    void notifyall();

  private:
    pthread_cond_t cond_;
    MutexLock &mutex_;
};

} // end of namespace wd
